<template>
  <div class="reserve">
    <basic-container>
      <basic-container>
        <avue-crud
          :option="option"
          :data="data"
          :page.sync="page"
          @on-load="onLoad"
          :search.sync="search"
          @refresh-change="onLoad"
          @search-change="searchChange"
        >
          <template slot="menuLeft" slot-scope="{ size }">
            <el-button
              type="primary"
              size="small"
              icon="el-icon-plus"
              @click="handleAdd"
              >创建
            </el-button>
          </template>

          <template slot-scope="{ type, size, row }" slot="menu">
            <el-button
              icon="el-icon-edit"
              :size="size"
              :type="type"
              @click="goToDetailsList(row)"
              >编辑
            </el-button>

            <!-- <el-button
              icon="el-icon-delete"
              :size="size"
              :type="type"
              @click="handleRemove(row)"
              >删除
            </el-button> -->

            <el-button
              icon="el-icon-check"
              :size="size"
              :type="type"
              @click="handlePreview(row)"
              >查看
            </el-button>

            <!-- <el-switch
              :value="row.status === 1"
              @input="val => handleSwitch(row, val)"
              size="small"
              active-text="上下架"
              class="switch"
            ></el-switch> -->
          </template>
        </avue-crud>
      </basic-container>
    </basic-container>
  </div>
</template>

<script>
export default {
  name: "Reserve",
  data() {
    return {
      user: {},
      search: {},
      promote: true,
      gaugeId: "",
      questionPreviewVisible: false,
      page: {
        pageSize: 20,
      },
      option: {
        addBtnText: "添加量表",
        addBtn: false,
        excelBtn: false,
        delBtn: false,
        editBtn: false,
        border: true,
        index: true,
        expandLevel: 3,
        headerAlign: "left",
        align: "left",
        tree: false,
        labelWidth: 100,
        menuWidth: 280,
        column: [
          {
            width: 130,
            label: "发布编号",
            prop: "gaugeNo",
          },
          {
            label: "发布时间",
            prop: "gaugeTypeName",
            type: "select",
            // formslot: true,
            // searchslot: true,
            // search: true,
            props: {
              label: "typeName",
              value: "typeName",
            },
            dicUrl: "/api/blade-measure/measure/gaugetype/listAll?typeName=",
          },
          {
            label: "预约截止时间",
            prop: "title",
            // search: true
          },
          {
            label: "预约时间",
            prop: "title",
            // search: true
          },
          {
            label: "预约人数",
            prop: "title",
            // search: true
          },
          {
            label: "年级",
            prop: "title",
            // search: true
          },
          {
            label: "班级",
            prop: "title",
            // search: true
          },
          {
            label: "预约发布说明",
            prop: "title",
            // search: true
          },
          {
            label: "被辅导对象",
            prop: "title",
            // search: true
          },
          // {
          //   label: "答题时间",
          //   prop: "cost"
          // }
        ],
      },
      data: [],
      query: {},
    };
  },
};
</script>

<style lang="scss" scoped>
.reserve {
}
</style>
